package com.zablert.lazyutil.main;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Arrays;

public class MainAction extends DefaultActionGroup {

    /**
     * 控制action group是否展示及可用
     */
    @Override
    public void update(@NotNull AnActionEvent e) {
        super.update(e);
    }

    /**
     * 动态返回action列表。也可以包含action group
     */
    @NotNull
    @Override
    public AnAction[] getChildren(@Nullable AnActionEvent e) {
        AnAction[] a = super.getChildren(e);
        System.out.println(Arrays.toString(Arrays.stream(a).toArray()));
        return a;
    }
}
